import React from 'react'

class Handler extends React.Component {
  state = {
    count: 100
  }
  render() {
    return (
      <div>
        <div>我是类组件</div>
        <p>{this.state.count}</p>
        <button onClick={() => {
          // this.setState的作用
          // 1. 修改数据
          // 2. 更新视图
          this.setState({
            count: this.state.count + 1
          })
        }}>点击改变状态</button>
      </div>
    )
  }
}

export default Handler